package util;

import play.Logger;

public class NumberValidator {

    public static boolean isValidNumber(String number) {
        try {
            int validNumber = Integer.valueOf(number);
            if (validNumber >= -999999) {
                if (validNumber < 999999) {
                    return true;
                }else {
                    Logger.error("Number in bigger than 99999: "+validNumber);
                    return false;
                }
            }
            Logger.error("Number in smaller than 0: "+validNumber);
            return false;
        } catch (Exception e) {
            Logger.error(e, "Is not a valid Number: %s", number);
            return false;
        }
    }

}
